package org.spring.aicloud.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;

import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;


/**
 * <p>
 * 
 * </p>
 *
 * @author yexiebao
 * @since 2025-05-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user")
//实现 Serializable 接口，表示此类的对象可以被序列化，用于网络传输或持久化存储。
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键，该注解用于标识实体类的主键字段
     */
    @TableId(value = "uid", type = IdType.AUTO)
    private Long uid;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空")
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    private String password;

    /**
     * 头像
     */
    private String photo;

    /**
     * 状态，预留字段
     */
    private Integer state;

    /**
     * 创建时间
     */
    private LocalDateTime createtime;

    /**
     * 修改时间
     */
    private LocalDateTime updatetime;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 每天可以使用大模型的次数
     */
    private Integer usecount;

    //生成所有的set和get方法
    public Long getUid() {return uid;}

    public void setUid(Long uid) {this.uid = uid;}

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() { return password; }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getState() { return state; }
    public void setState(Integer state) { this.state = state;}
}
